package com.situ.report.controller;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.situ.report.entity.ls;
import com.situ.report.service.LsService;
import com.situ.util.ResponseData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
public class Lscontroller {
    @Autowired
    LsService lsService;

    @RequestMapping("queryLost")
    public ResponseData query(ls l,
    @RequestParam(defaultValue ="1", required = false) int startPage ,
    @RequestParam(defaultValue = "5",required = false) int PageSize){
        PageHelper.startPage(startPage,PageSize );
        List<ls> list = lsService.queryall(l);
        PageInfo pageInfo=new PageInfo(list,5);
        return ResponseData.ok().putDataValue("pageInfo",pageInfo);
    }
}
